<?php include template("header");?>

<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="order-detail">
	<div class="dashboard" id="dashboard">
		<ul><?php echo current_account(null); ?></ul>
	</div>
    <div id="content">
		<div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
                <div class="head">
                    <h2>Detalhes</h2>
                </div>
                <div class="sect">

<table cellspacing="0" cellpadding="0" border="0" class="data-table">
    <tr>
        <th>Pedido:</th>
        <td class="orderid"><strong><?php echo $order['id']; ?></strong></td>
        <th>Data:</th>
        <td><span><?php echo date('d-m-Y H:i',$order['create_time']); ?></span></td>
    </tr>
<?php if($order['condbuy']){?>
    <tr>
        <th><?php echo $team['condbuy_titulo']; ?>:</th>
        <td colspan="3" class="status"><?php echo $order['condbuy']; ?></td>
    </tr>
<?php }?>
<?php if($order['remark']){?>
    <tr>
        <th>Notas:</th>
        <td colspan="3" class="status"><?php echo htmlspecialchars($order['remark']); ?></td>
    </tr>
<?php }?>
</table>

<table cellspacing="0" cellpadding="0" border="0" class="info-table">
    <tr>
        <th class="left" width="auto">Nome da oferta</th>
        <th width="35">Preço</th>
        <th width="10"></th>
        <th width="45">Quantidade</th>
        <th width="10"></th>
        <th width="45">Total</th>
        <th width="150">Status</th>
    </tr>
    <tr>
        <td class="left"><a href="/team.php?id=<?php echo $order['team_id']; ?>" target="_blank"><?php echo $team['title']; ?></a></td>
        <td><span class="money"><?php echo $currency; ?></span><?php echo moneyit3($order['price']); ?></td>
        <td>x</td>
        <td><?php echo $order['quantity']; ?></td>
        <td>=</td>
        <td class="total"><span class="money"><?php echo $currency; ?></span><?php echo moneyit3($order['price']*$order['quantity']); ?></td>
        <td class="status"><?php if(!$express&&!$order['card_id']){?>Oferta realizada com sucesso<?php } else { ?>-<?php }?></td>
    </tr>

<?php if($order['card_id']){?>
    <tr>
        <td class="left">cartão?<?php echo $order['card_id']; ?></td>
        <td><?php echo moneyit3($order['card']); ?></td>
        <td>x</td>
        <td>1</td>
        <td>=</td>
        <td class="total"><span class="money"><?php echo $currency; ?></span><?php echo moneyit3($order['card']); ?></td>
        <td class="status">-</td>
    </tr>
<?php }?>

<?php if($express){?>
    <tr>
        <td class="left">express</td>
        <td><?php echo moneyit3($team['fare']); ?></td>
        <td>x</td>
        <td>1</td>
        <td>=</td>
        <td class="total"><span class="money"><?php echo $currency; ?></span><?php echo moneyit3($team['fare']); ?></td>
        <td class="status">-</td>
    </tr>
<?php }?>

<?php if($express||$order['card_id']){?>
    <tr>
        <td class="left"></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td class="total"><span class="money"><?php echo $currency; ?></span><?php echo moneyit3($order['origin']); ?></td>
        <td class="status">Acordo efetuado com sucesso</td>
    </tr>
<?php }?>

</table>

<?php if($team['delivery']=='coupon'){?>
<table cellspacing="0" cellpadding="0" border="0" class="data-table">
    <tr>
        <th><?php echo $INI['system']['couponname']; ?>:</th>
        <td class="other-coupon"><?php if(empty($coupons)){?>
          O <?php echo $INI['system']['couponname']; ?> será enviado após a oferta ser ativa
          <?php }?><?php if(is_array($coupons)){foreach($coupons AS $one) { ?>
          <p><?php echo $one['id']; ?> - <?php echo $one['secret']; ?></p><?php }}?></td>
    </tr>
    <tr>
        <th>Como usar:</th>
        <td>Imprima seu <?php echo $INI['system']['couponname']; ?> e entregue no estabelecimento quando for utilizar.</td>
    </tr>
</table>
<?php } else if($team['delivery']=='express') { ?>
<table cellspacing="0" cellpadding="0" border="0" class="data-table">
    <tr>
        <th>express?</th>
	<?php if($order['express_id']){?>
        <td><?php echo $option_express[$order['express_id']]; ?>?<?php echo $order['express_no']; ?></td>
	<?php } else { ?>
        <td class="other-coupon">Aguarde pela entrega.</td>
	<?php }?>
    </tr>
    <tr>
        <th>Quem irá receber:</th>
        <td><?php echo $order['realname']; ?></td>
    </tr>
    <tr>
        <th>Endereço:</th>
        <td><?php echo $order['address']; ?></td>
    </tr>
    <tr>
        <th>Número de celular:</th>
        <td><?php echo $order['mobile']; ?></td>
    </tr>
</table>
<?php } else if($team['delivery']=='pickup') { ?>
<table cellspacing="0" cellpadding="0" border="0" class="data-table">
    <tr>
        <th>Auto-entrega:</th>
        <td class="other-coupon"></td>
    </tr>
    <tr>
        <th>Localização:</th>
        <td><?php echo $team['address']; ?></td>
    </tr>
    <tr>
        <th>Telefone:</th>
        <td><?php echo $team['mobile']; ?></td>
    </tr>
</table>
<?php }?>
                </div>
            </div>
            <div class="box-bottom"></div>
        </div>
    </div>
    <div id="sidebar">
    </div>
</div>

</div> <!-- bd end -->
</div> <!-- bdw end -->

<?php include template("footer");?>
